package bean;

import java.sql.ResultSet;
import java.sql.SQLException;

import common.RowMapper;

public class OrderInfoRowMapper implements RowMapper<OrderInfo> {

	@Override
	public OrderInfo mapper(ResultSet rs) throws SQLException {
		OrderInfo oi=new OrderInfo();
		oi.setOrderid(rs.getInt("orderid"));
		oi.setUserid(rs.getInt("userid"));
		oi.setAddressid(rs.getInt("addressid"));
		oi.setPayStatus(rs.getInt("pay_status"));
		oi.setPostStatus(rs.getInt("post_status"));
		oi.setOrderStatus(rs.getInt("order_status"));
		oi.setGoodsNum(rs.getInt("goods_num"));
		oi.setTotalPrice(rs.getDouble("total_price"));
		oi.setPayPrice(rs.getDouble("pay_price"));
		oi.setPointsUsed(rs.getInt("points_used"));
		oi.setPostFee(rs.getDouble("post_fee"));
		oi.setCreateTime(rs.getTimestamp("create_time"));
		oi.setUpdateTime(rs.getTimestamp("update_time"));
		return oi;
	}

}
